using System.Collections.Generic;
using System.Linq;

namespace CommonServiceManager.Extensions
{
	/// <summary>
	/// Extensions on <see cref="IEnumerable{T}"/>
	/// </summary>
	public static class IEnumerableExtensions
	{
		/// <summary>
		/// Is the <see cref="IEnumerable{T}"/> null or empty
		/// </summary>
		/// <param name="enumerable">The enumarable we want to check</param>
		/// <returns>True if the <paramref name="enumerable"/> is null or empty</returns>
		public static bool IsNullOrEmpty<T>(this IEnumerable<T> enumerable)
		{
			return enumerable == null || !enumerable.Any();
		}
	}
}